<?php
$xajax = new xajax(); 
//$xajax->debugOn(); // Uncomment this line to turn debugging on
$xajax->registerFunction("processLoginForm");

$xajax->registerFunction("checkUsername");
$xajax->registerFunction("processRegForm");

$xajax->processRequests();
?>

<?php get_header(); ?>
<?php check_userlogin(); ?>
<DIV id=container>

<p/>
<DIV id=formz>

<h2><A href="<?=get_option('siteurl')?>">首页</A> &#187; 登录</h2>

<DIV id=contents>
<FIELDSET><LEGEND>用户登录</LEGEND>
<form id="loginForm" action="javascript:void(null);" onsubmit="submitLogin();">
<br/>
<P class=l-top><LABEL for=name>用户名:</LABEL><BR><INPUT id=name tabIndex=1 size=25 name=username maxlength=24></P>
<P class=l-top><LABEL for=password>密码:</LABEL><BR><INPUT id=password tabIndex=2 type=password size=25 name=password maxlength=25></P>

<INPUT class=log2 tabIndex=4 type=submit value=登录 name=submitButton id=submitButton>

</FORM>
<span id="errormsg"><br/></span>
<P><span onclick="new Effect.SlideDown('register_on_loginpage'); return false;"><A href="#register">新用户注册</A></span></P>
</FIELDSET>

<div id="register_on_loginpage" style="display:none">
<FIELDSET><LEGEND>注册新用户</LEGEND>
<A name="#register"></A>
<form id="signupForm" action="javascript:void(null);" onsubmit="submitSignup();">

<div id="reg-name" >
<label for="name">用户名:</label><BR>
<INPUT id=name-reg onkeyup="enablebutton(this.form.checkbutton, this.form.submitButton, this)" tabIndex=1 size=25 name=username maxlength=24>
<SPAN id=checkit><INPUT id=checkbutton disabled onclick="xajax_checkUsername(document.getElementById('name-reg').value);" type=button value="检查是否可用" name=checkbutton></SPAN> 
<BR><SPAN id=checkitvalue></SPAN>
<span class="form-note">支持中文用户名，不能有空格.</span>
<span id="checknamemsg"><br/></span>
</div>

<div id="reg-email">
<label for="email">邮件地址:</label><BR>
<INPUT id=email style="WIDTH: 20em" tabIndex=3 size=25 name=email>
<SPAN class=form-note> 邮件地址只有管理员可见.
我们将保护您的个人信息，详见：<A href="./?services">服务条款</A>.</SPAN>
<span id="checkemailmsg"><br/></span>
</div>

<div id="reg-pass">
<label for="password">密码:</label><BR>
<INPUT id=newPass1 tabIndex=4 type=password size=25 name=newPass1 maxlength=25><span class="form-note">最少6个字符</span></P>
<div class=l-mid><LABEL for=verify>重复密码:</LABEL><BR>
<INPUT id=newPass2 tabIndex=5 type=password size=25 name=newPass2 maxlength=25>
</div>
<span id="checkpassmsg"><br/></span>
<P class=l-bot><INPUT class=log2 tabIndex=6 type=submit value="创建新账号" name=submitButton></P>
</div>

</form></FIELDSET></div>

</DIV></DIV></DIV>
  
<?php get_footer(); ?>